package com.cloud.freeflow.api.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloud.freeflow.api.entity.ProcActAttr;
import com.cloud.freeflow.api.entity.ProcActProperty;
import com.cloud.freeflow.api.entity.ProcActType;
import com.cloud.freeflow.api.mapper.ProcActAttrMapper;
import com.cloud.freeflow.api.mapper.ProcActPropertyMapper;
import com.cloud.freeflow.api.mapper.ProcActTypeMapper;
import com.cloud.freeflow.api.service.ProcDictService;

import tk.mybatis.mapper.entity.Example;

@Service
public class ProcDictServiceImpl implements ProcDictService {
	@Autowired
	private ProcActTypeMapper procActTypeMapper;

	@Autowired
	private ProcActPropertyMapper procActPropertyMapper;
	
	@Autowired
	private ProcActAttrMapper procActAttrMapper;

	@Override
	public List<ProcActType> loadProcActType() {
		Example example = new Example(ProcActType.class);
		Example.Criteria criteria = example.createCriteria();
		criteria.andEqualTo("deleteFlag", 0);
		example.orderBy("displayOrder");
		return procActTypeMapper.selectByExample(example);
	}

	@Override
	public List<ProcActProperty> loadProcActProperty() {
		Example example = new Example(ProcActProperty.class);
		Example.Criteria criteria = example.createCriteria();
		criteria.andEqualTo("deleteFlag", 0);
		example.orderBy("displayOrder");
		return procActPropertyMapper.selectByExample(example);
	}
	
	@Override
	public List<ProcActAttr> loadProcActAttr() {
		Example example = new Example(ProcActAttr.class);
		Example.Criteria criteria = example.createCriteria();
		criteria.andEqualTo("deleteFlag", 0);
		example.orderBy("displayOrder");
		return procActAttrMapper.selectByExample(example);
	}

}
